package com.example.skillcinema.di

import android.app.Application
import androidx.room.Room
import com.example.skillcinema.db.localdb.ApplicationDataBase
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object AppModule {

    @Provides
    @Singleton
    fun provideApplicationDatabase(app: Application): ApplicationDataBase {
        return Room.databaseBuilder(
            app.applicationContext,
            ApplicationDataBase::class.java,
            "db"
        ).build()
    }
}